﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RemoteTestRunner.FormsUI
{
    public partial class LongRunning : Form, RemoteTestRunner.BusinessLogic.Views.ILongRunningView
    {
        private DateTime _processStartTime = DateTime.Now;
        public LongRunning()
        {
            InitializeComponent();
            UpdateRunningLength();
        }

        private void UpdateRunningLength()
        {
            TimeSpan difference = DateTime.Now.Subtract(_processStartTime);
            TimeSpan differenceTruncated = new TimeSpan(0, 0, (int)difference.TotalSeconds);
            lblRunningTime.Text = "Running for: " + differenceTruncated.ToString();
        }

        private void tmrUpdateRunTime_Tick(object sender, EventArgs e)
        {
            UpdateRunningLength();
        }

        public string Description { get { return lblProcessDescription.Text; } set { lblProcessDescription.Text = value; } }

    }
}
